Home |
| Latest | About | Random
# 12a Application of matrix-vector product to matrix properties. Let us recall the matrix-vector ways of multiplying matrices: > **Matrix-vector product as linear combination.** > Let $A$ be a matrix with columns $\vec a_{1},\vec a_{2},\ldots,\vec a_{k}$, so $A = \begin{bmatrix}\vec a_{1} & \vec a_{2} & \cdots & \vec a_{k}\end{bmatrix}$, and let $\vec x = \begin{bmatrix}x_{1}\\x_{2}\\\vdots \\ x_{k}\end{bmatrix}$, then we have $$A\vec x=x_{1}\vec a_{1} + x_{2}\vec a_{2}+\cdots +x_{k}\vec a_{k}.$$ As well as its generalization: > **Matrix-vector matrix product formula.** > Let $A$ and $B$ be matrices whose product $AB$ exists. And let $\vec b_{1}, \vec b_{2},\ldots,\vec b_{p}$ be the columns of $B$, that is $B=\begin{bmatrix}\vec b_{1} & \vec b_{2} & \cdots & \vec b_{p}\end{bmatrix}$. Then the product $AB$ is given by $$AB=\begin{bmatrix}A\vec b_{1} & A\vec b_{2} & \cdots & A\vec b_{p}\end{bmatrix}$$ We can use these rules to demonstrate various matrix properties, but instead of showing entry-by-entry, we do a **column-by-column** analysis. To start, let us demonstrate the following result: > **Property. Functional associativity.** > Let $A$ be a matrix of size $n\times k$, let $B$ be $k\times p$, and let $\vec x$ be a column vector of size $p\times 1$. Then $$A(B\vec x)=(AB)\vec x$$ Note this is just matrix associativity, with the special case that third matrix is a column vector. We have proved the general situation already. But let us do this special case using our matrix-vector formulas. Indeed, if we let $B = \begin{bmatrix}\vec b_{1} & \vec b_{2} & \cdots &\vec b_{p}\end{bmatrix}$ and $\vec x =\begin{bmatrix}x_{1}\\x_{2}\\\vdots\\ x_{p}\end{bmatrix}$. Then note $$ \begin{align*} A(B\vec x) &= A(x_{1} \vec b_{1} + x_{2}\vec b_{2}+\cdots +x_{p}\vec b_{p}) \\ &=x_{1}A\vec b_{1} +x_{2}A\vec b_{2}+\cdots +x_{p}A\vec b_{p} \\ &=\begin{bmatrix} A\vec b_{1} & A\vec b_{2} & \cdots & A\vec b_{p} \end{bmatrix}\begin{bmatrix} x_{1}\\x_{2}\\\vdots\\x_{p} \end{bmatrix} \\ &=(AB)\vec x . \quad\blacklozenge \end{align*} $$ Let us use this to show associativity of matrix product again. But instead of showing entry-by-entry, we again do a **column-by-column** analysis. > **Property. Associativity.** > Let $A,B,C$ be matrices where their products are defined. Then $$A(BC)=(AB)C.$$ Suppose $C$ has columns $\vec c_{1}, \vec c_{2},\ldots,\vec c_{p}$. Then note that $$ \begin{align*} BC &= B\begin{bmatrix} \vec c_{1} & \vec c_{2} & \cdots & \vec c_{p} \end{bmatrix} \\ &= \begin{bmatrix} B\vec c_{1} & B \vec c_{2} & \cdots & B\vec c_{p} \end{bmatrix} \end{align*} $$by our matrix-vector formula. Then $A(BC)$ is given by $$ \begin{align*} A(BC) &= A\begin{bmatrix} B\vec c_{1} & B \vec c_{2} & \cdots & B\vec c_{p} \end{bmatrix} \\ &=\begin{bmatrix} A(B\vec c_{1}) & A(B \vec c_{2}) & \cdots & A(B\vec c_{p}) \end{bmatrix} \\ &=\begin{bmatrix} (AB)\vec c_{1} & (AB) \vec c_{2} & \cdots & (AB)\vec c_{p} \end{bmatrix} \\ &=(AB)\begin{bmatrix} \vec c_{1} & \vec c_{2} & \cdots & \vec c_{p} \end{bmatrix} \\ &=(AB)C.\quad\blacklozenge \end{align*} $$ We can also convince ourselves that we have matrix distributivity using this matrix-vector formulation: > **Property. Left-distributivity.** > Let $A$ be some $n\times k$ matrix, and let $B,C$ be $k\times p$ matrices. Then $A(B+C)=AB+AC$. Instead of proving the left hand side matrix is equal to the right hand side entry by entry before, we now show they are equal **column by column**: Suppose the columns of $B$ are $\vec b_{1},\vec b_{2},\ldots,\vec b_{p}$, and the columns of $C$ are $\vec c_{1}, \vec c_{2},\ldots,\vec c_{p}$. Then note that $$ \begin{align*} A(B+C)&=A\left(\begin{bmatrix} \vec b_{1} & \vec b_{2} & \cdots & \vec b_{p} \end{bmatrix}+\begin{bmatrix} \vec c_{1} & \vec c_{2} & \cdots & \vec c_{p} \end{bmatrix}\right) \\ &= A\left(\begin{bmatrix} \vec b_{1}+\vec c_{1} & \vec b_{2}+ \vec c_{2} & \cdots & \vec b_{p}+\vec c_{p} \end{bmatrix}\right) \\ & = \begin{bmatrix} A(\vec b_{1}+\vec c_{1}) & A(\vec b_{2}+ \vec c_{2}) & \cdots & A(\vec b_{p}+\vec c_{p}) \end{bmatrix} \\ &= \begin{bmatrix} A\vec b_{1}+A\vec c_{1} & A\vec b_{2}+ A\vec c_{2} & \cdots & A\vec b_{p}+A\vec c_{p} \end{bmatrix} \\ &=\begin{bmatrix} A\vec b_{1} & A\vec b_{2} & \cdots & A\vec b_{p} \end{bmatrix}+\begin{bmatrix} A\vec c_{1} & A\vec c_{2} & \cdots &A\vec c_{p} \end{bmatrix} \\ &=AB + AC. \quad\blacklozenge \end{align*} $$Of course here we have to believe that $A(\vec b_{i}+\vec c_{i})=A\vec b_{i}+A\vec c_{i}$, but that isn't terrible to show. **Bottom-line: This matrix-vector formulation of matrix product is consistent with the properties of matrix product.**